<?php

namespace api\v1\controller;
/*
 * Edit by shengxin
 * Click nbfs://nbhost/SystemFileSystem/Templates/Scripting/PHPClass.php to edit this template
 */

use api\base\CRestBase;
use think\facade\Log;
/**
 * Description of MembersController
 *
 * @author PC
 */
class MembersController extends CRestBase{
    private $userStr = '{
		
		"id": "07d51f5d1577423ca1d82a570ee34fd9",
		"username": "15604086208",
		"name": "南",
		"nickName": "南",
		"imageUrl": null,
		"mobile": "15604086208",
		"memberType": 0,
		"sex": 1,
		"grade": null,
		"deviceStatus": "1",
		"systemVersion": "Funtouch13.0",
		"mobileBrand": "vivo",
		"mobileModel": "V2046A",
		"registerDate": "2024-05-08 11:42:02",
		"expireDate": "2024-07-13 14:30:42",
		"expireTimeStamp": 1750035133000,
		"payFee": 29.90,
		"teacherPattern": null,
		"teacherPatternId": null,
		"parentPattern": 1,
		"province": null,
		"provinceId": "",
		"city": null,
		"cityId": "",
		"district": null,
		"districtId": "",
		"longitude": 121.598723,
		"latitude": 38.918946,
		"qrCode": "/upload/agentQRCode/20240508/e49f550c5541af22e60de10dd02b1ca4.png",
		"organizationId": "40cf9d0290714d2d9b44b3bf0f8b6387",
		"companyId": null,
		"token": null,
		"clientId": null,
		"isBindParent": true,
		"isBindTeacher": false,
		"lastLocTime": "2024-06-13 13:51:19",
		"lastLocTimeStamp": 1718257879000,
		"msgDot": false,
		"subIoSwitch": true,
		"subInsSwitch": true,
		"subBwSwitch": true,
		"subBaSwitch": true,
		"subIconSwitch": 1,
		"schoolId": null,
		"schoolName": null,
		"gradeId": null,
		"gradeName": null,
		"classroomId": null,
		"classroomName": null,
		"appDownChannel": "qqsksh_vivo"
	
}';
    public function login(){
        $user = $this->userStr;
        $token = "eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiIxNTYwNDA4NjIwOCIsImF1dGhvcml0aWVzIjoiIiwiZXhwIjoxODA0NjQwMjk5fQ.XoUv-gwOwNwdHy4sIMwiOqTT9whGLNDWZ5njIzFzK2Pbh7MnpI1GMAqP7HSl0KZnQGYmMXx-0WanTWhZNSMp5g";
        $udata = json_decode($user,true);
        $udata['token'] = $token;
        return $this->success('ok', $udata);
    }
    
    public function studentIdCodeLogin(){
        return $this->login();
    }
    
    
    public function getMemberInfo(){
        Log::info("memberinfo {header}",['header'=> print_r($this->request->header(),true)]);
        $studentId = $this->request->get('studentId');
        $user = $this->userStr;
        return $this->success('ok', json_decode($user,true));
    }
    
}
